package com.bweab.controll.depositcontroll.en;

import com.bweab.pojo.DepositTb;
import com.bweab.service.api.DepositTbServiceInterface;
import com.bweab.service.api.en.DepositTbEnServiceInterface;
import com.bweab.service.impl.DepositTbServiceInterfaceImpl;
import com.bweab.service.impl.en.DepositTbEnServiceInterfaceImpl;
import com.bweab.util.JSONResult;
import com.bweab.util.PageList;
import com.bweab.util.WebUtil;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.util.List;

@WebServlet("/queryDepositInfoById")
public class QueryDepositInfoById extends HttpServlet {


    //创建服务对象
    DepositTbEnServiceInterface depositTbEnService =new DepositTbEnServiceInterfaceImpl();
    //创建返回结果
    JSONResult jsonResult =new JSONResult();
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //获取充值记录id
        int  depositId= Integer.parseInt(req.getParameter("depositId"));
        int page= Integer.parseInt(req.getParameter("page"));
        int pageSize= Integer.parseInt(req.getParameter("pageSize"));


        //调用dao
        PageList depositTbList=depositTbEnService.queryDepositInfoByDepositId(depositId,page,pageSize);

        //设置信息

        WebUtil.writeJson(resp,depositTbList);
    }
}
